﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TK.Socket
{
    /// <summary>
    /// 数据发送接口,链接可能已断开
    /// </summary>
    public interface ISend
    {
        /// <summary>
        /// 当前链接发送数据
        /// </summary>
        void Send(byte[] data);

        /// <summary>
        /// 特定sessionId链接发送数据
        /// </summary>
        void Send(int sessionId, byte[] data);

        /// <summary>
        /// 关联服务的所有客户端发送数据
        /// </summary>
        void SendAll(byte[] data);

        /// <summary>
        /// 关闭当前链接,一般服务端不主动关闭链接
        /// </summary>
        void Close();
    }
}
